//
//  TTHorizontalButton.m
//  MeetCard
//
//  Created by timtian on 16/12/1.
//  Copyright © 2016年 timtian. All rights reserved.
//

#import "TTHorizontalButton.h"
@interface TTHorizontalButton()

@property(nonatomic, assign) CGFloat imgRight;
@end
@implementation TTHorizontalButton

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = _kFont32;
        [self setTitleColor:kColorA6A6A6 forState:UIControlStateNormal];
        
        self.imgRight = 12;
    }
    return self;
}

-(CGRect)imageRectForContentRect:(CGRect)contentRect{
    CGFloat imageW = 19;
    
    CGRect imageRect = CGRectMake((contentRect.size.width-imageW) * 0.1,
                                  0,
                                  imageW, imageW);
    
    return imageRect;
}

-(CGRect)titleRectForContentRect:(CGRect)contentRect{
    CGFloat titleW = 25  ;
    CGFloat titleH = 24;
    CGRect titleRect = CGRectMake((contentRect.size.width-titleW) * 0.2+self.imgRight+10,
                                  0,
                                  titleW,
                                  titleH);
    return titleRect;
}

@end
